package edu.spbu.eclipse.xmledit.andrpodk.editors;

import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.editors.text.TextEditor;

import edu.spbu.eclipse.xmledit.andrpodk.XSLTManager;

public class XMLEditor extends TextEditor {
	private XSLTManager xsltManager;

	private ColorManager colorManager;

	public XMLEditor() {
		super();
		colorManager = new ColorManager();
		setSourceViewerConfiguration(new XMLConfiguration(colorManager));
		setDocumentProvider(new XMLDocumentProvider());				
	}
	public void dispose() {
		colorManager.dispose();
		super.dispose();
	}
	public XSLTManager getXsltManager() {
		return xsltManager;
	}
	public void init(IEditorSite site, IEditorInput input) throws PartInitException{ 
		super.init(site,input);		
		xsltManager=new XSLTManager(this);
		addPropertyListener(xsltManager);
	}
}
